import { createRouter, createWebHashHistory,RouteRecordRaw } from 'vue-router'

type ReadonlyRouteRecordRaw = Readonly<RouteRecordRaw>;

  const routes: ReadonlyRouteRecordRaw[] = [
  {
    path: '/',
    component: () => import('../view/Login.vue'),
    meta: { layout: 'empty' } // 标记使用空白布局
  },
  {
    path: '/regeister',
    component: () => import('../view/Regeister.vue'),
    meta: { layout: 'empty' } // 标记使用空白布局
  },
  {
    path: '/profile',
    component: () => import('../view/Profile.vue'),
    meta: { layout: 'main', requiresAuth: true } // 标记使用主布局
  },
  {
    path: '/about',
    component: () => import('../view/About.vue'),
    meta: { layout: 'main', requiresAuth: true } // 标记使用主布局
  },
  {
    path: '/home',
    component: () => import('../view/home/Home.vue'),
    meta: { layout: 'main', requiresAuth: true } // 标记使用主布局
  },
  {
    path: '/course',
    component: () => import('../view/course/Course.vue'),
    meta: { layout: 'main', requiresAuth: true } // 标记使用主布局
  },
  {
    path: '/notice',
    component: () => import('../view/notice/Notice.vue'),
    meta: { layout: 'main', requiresAuth: true } // 标记使用主布局
  },
  {
    path: '/courselist',
    component: () => import('../view/course/CourseList.vue'),
    meta: { layout: 'main', requiresAuth: true } // 标记使用主布局
  },
  {
    path: '/lession',
    component: () => import('../view/course/Lession.vue'),
    meta: { layout: 'main', requiresAuth: true } // 标记使用主布局
  },
  {
    path: '/classroom',
    component: () => import('../view/course/ClassRoom.vue'),
    meta: { layout: 'main', requiresAuth: true } // 标记使用主布局
  },
  {
    path: '/classroomaudio',
    component: () => import('../view/course/ClassRoomAudio.vue'),
    meta: { layout: 'main', requiresAuth: true } // 标记使用主布局
  },
  {
    path: '/classroomscript',
    component: () => import('../view/course/ClassRoomScript.vue'),
    meta: { layout: 'main', requiresAuth: true } // 标记使用主布局
  },
  {
    path: '/Calendar',
    component: () => import('../view/Calendar.vue'),
    meta: { layout: 'main', requiresAuth: true } // 标记使用主布局
  },
  {
    path: '/live',
    component: () => import('../view/Live.vue'),
    meta: { layout: 'main', requiresAuth: true } // 标记使用主布局
  },
  {
    path: '/room',
    component: () => import('../view/course/Room.vue'),
    meta: { layout: 'empty', requiresAuth: true } // 标记使用主布局
  },
  {
    path: '/liveStu',
    component: () => import('../view/LiveStu.vue'),
    meta: { layout: 'empty', requiresAuth: true } // 标记使用主布局
  },
  {
    path: '/institution',
    component: () => import('../view/info/Institution.vue'),
    meta: { layout: 'main', requiresAuth: true } // 标记使用主布局
  },
  {
    path: '/tool',
    component: () => import('../view/info/Tool.vue'),
    meta: { layout: 'main', requiresAuth: true } // 标记使用主布局
  },
  {
    path: '/message',
    component: () => import('../view/info/Message.vue'),
    meta: { layout: 'main', requiresAuth: true } // 标记使用主布局
  },
  {
    path: '/setting',
    component: () => import('../view/info/Setting.vue'),
    meta: { layout: 'main', requiresAuth: true } // 标记使用主布局
  },
  {
    path: '/help',
    component: () => import('../view/info/Help.vue'),
    meta: { layout: 'main', requiresAuth: true } // 标记使用主布局
  },
  {
    path: '/Main',
    component: () => import('../view/Main.vue'),
    meta: { layout: 'main', requiresAuth: true },// 标记使用主布局
    children: [
      {
        path: '/Main',
        name: 'Main',
        component: () => import('../view/home/Home.vue')
      },
    ]
  }
]
const router = createRouter({
  history: createWebHashHistory(),
  routes: routes
})

export default router
